Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 18, 2024 10:20
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@saibotsivad
saibotsivad / downthemall.sh
Created December 29, 2015 16:45
Download all these free math books!
#!/bin/bash
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-1779-2.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-2103-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9884-4.pdf
wget http://link.springer.com/content/pdf/10.1007/978-3-662-02945-9.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4612-9923-3.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4757-3828-5.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4684-9936-0.pdf
wget http://link.springer.com/content/pdf/10.1007/978-1-4419-8566-8.pdf
@msnazarow
msnazarow / Image+Trim.swift
Last active May 18, 2024 10:16 — forked from chriszielinski/Image+Trim.swift
[Swift 5] NSImage/UIImage Crop/Trim Transparency
// Image+Trim.swift
//
// Copyright © 2020 Christopher Zielinski.
// https://gist.github.com/chriszielinski/aec9a2f2ba54745dc715dd55f5718177
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@karthiks
karthiks / wsl-cheatsheet.ps1
Last active May 18, 2024 10:15
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name
@judge2020
judge2020 / plot_discord_predictions.py
Created May 18, 2024 04:05 — forked from rebane2001/plot_discord_predictions.py
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
import glob
import json
from datetime import datetime
from matplotlib import pyplot
age_ts = []
age_keys = ["prob_13_17", "prob_18_24", "prob_25_34", "prob_35_over"]
age_lists = {k:[] for k in age_keys}
gen_ts = []
float getTemp(){
//wait until predefined amount between IC request.
//Dont constantly request, the chip will heat up.
if(millis() - previousTempReading < tempReadingInterval){
Serial.println("Passing temperature reading. This is not the time.");
return;
}
//We cant just request and receive the temperature reading. It takes time on DS18B20 devices.
//For 12bit precision it takes 750ms to finish conversion.
//Only usable for first device on the line
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@nikgalushko
nikgalushko / main.go
Created May 10, 2024 11:48
gocrew3 sqlite
package main
import (
"database/sql"
"fmt"
"math/rand"
"os"
"path/filepath"
"time"

Cygwin, MSYS, MSYS2, MinGW, mingw-w64, WSL, WSL2 の違い

名称 役割 説明
MinGW コンパイラ Windows 用の GNU ツールチェーン。
とにかく Windows 用の gcc や GNU ld。
"Windows 用" とは、Windows 上で動作したり、Windows 用のアプリが作れたりすること。
要するに Visual C++ や Clang/LLVM みたいなもの。
mingw-w64 コンパイラ MinGW のフォーク。Win64 向けの改良が加わっており、2021 年現在の主流。
Cygwin POSIX 環境 Windows 用の POSIX 環境。cygwin1.
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'